<?php
defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();

if($_RQ['op']=='get'){
	$return['item']=$this->get_setting();
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '基本信息',
		  'edits' => 
		  array (
		    0 => 
		    array (
		      'title' => '基本设置',
		      'list' => 
		      array (
				array('type'=>'tip','title'=>'<red>还须--移步--短信设置，设置《签名》，才能发送短信！</red>'),
		        array (
		          'name' => 'appkey',
		          'type' => 'string',
		          'title' => 'appkey',
		        ),
		        array (
		          'name' => 'secret',
		          'type' => 'string',
		          'title' => 'secret',
		        ),
		        
		      ),
		    ),
			1 => 
		    array (
		      'title' => '短信设置',
		      'list' => 
		      array (
		        0 => 
		       array (
		          'name' => 'sign',
		          'type' => 'string',
		          'title' => '签名',
		        ),
		        
		      ),
			),
			2 => 
		    array (
		      'title' => '隐私号设置',
		      'list' => 
		      array (
		        0 => 
		       array (
		          'name' => 'poolkey',
		          'type' => 'string',
		          'title' => '号池key',
				  'help'=>'若后台查看不到号池key，可以提交工单询问'
		        ),
				array (
		          'name' => 'mobile',
		          'type' => 'text',
		          'title' => '隐私号码',
				  'help'=>'填写你购买的隐私号码，以英文逗号隔开，如 17000000000,17100000000，建议填2个以上',
		        ),
		        
		      ),
			),
			3 => 
		    array (
		      'title' => '语音短信设置',
		      'list' => 
		      array (
		        0 => 
				array (
		          'name' => 'showmobile',
		          'type' => 'string',
		          'title' => '显示号码',
				  'help'=>'填写你购买的显示号码',
		        ),
		        
		      ),
			),
		        
			
		  ),
		  
		);
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$this->save_setting($postdata);
	exi('设置成功！');
}
?>